Registry Guide for Windows Registry Guide for Windows
Part of the WinGuides Network
WinGuides Network and Software
Registry tweaks, tricks & hacks to optimize, enhance and secure Microsoft Windows.

Change the Command Prompt (Windows NT/2000/XP)
Category: Home > Windows > Accessories > Command Processor

Download this tweak with Tweak Manager!This tweak can be easily applied using WinGuides Tweak Manager.
Download a free trial now!

This setting allows you to change the format of the command prompt to show additional information instead of just the current drive and path ("C:\>").

Open your registry and find the key below.

Create or modify a REG_EXPAND_SZ string called "PROMPT" and set it to the required prompt format including any special codes or variables below.

Special Codes

  • $A - & (Ampersand)
  • $B - | (pipe)
  • $C - ( (Left parenthesis)
  • $D - Current date
  • $E - Escape code (ASCII code 27)
  • $F - ) (Right parenthesis)
  • $G - > (greater-than sign)
  • $H - Backspace (erases previous character)
  • $L - < (less-than sign)
  • $N - Current drive
  • $P - Current drive and path
  • $Q - = (equal sign)
  • $S - (space)
  • $T - Current time
  • $V - Windows XP version number
  • $_ - Carriage return and linefeed
  • $$ - $ (dollar sign)

    Variables

  • %USERNAME% - Current Username
  • %COMPUTERNAME% - Local computer name
  • %USERDOMAIN% - Local domain name

    The default prompt is "$P$G" (e.g. "C:\>"), some alternatives include:

  • [%computername%]$S$P$G to show the computer, drive and path
  • [%username%]$S$P$G to show the current user, drive and path

    Restart or log-off Windows for the change to take effect.

    Registry Editor Example
    |NameTypeData|
    |(Default)REG_SZ(value not set)|
    |PROMPTREG_EXPAND_SZ[%username%]$S$P$G|
    -
    |HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Envi...|
    -

    Settings:
    System Key: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\
    Environment]

    Name: PROMPT
    Type: REG_EXPAND_SZ (Expanded String Value)
    Value: Prompt Text (e.g. $P$G)

    Disclaimer: Modifying the registry can cause serious problems that may require you to reinstall your operating system. We cannot guarantee that problems resulting from modifications to the registry can be solved. Use the information provided at your own risk.

    Last Modified: January 29, 2003

  •  Return to Index Copyright © 1998-2003. All Rights Reserved.  License